package com.jcon.bos.service.impl.user;

import java.util.List;

import com.jcon.bos.domain.user.User;
import com.jcon.bos.service.base.BaseService;
import com.jcon.bos.service.user.UserService;
import com.jcon.bos.utils.MD5Utils;

public class UserServiceImpl extends BaseService implements UserService{

	@Override
	public User login(User user) {
		List<User> list = userDao.findByNamedQuery("User.login", user.getUsername(), MD5Utils.md5(user.getPassword()));
		return list.isEmpty() ? null : list.get(0);
	}

}
